/*
 * RightsManagerBean.java
 *
 * Created on 30 wrzesień 2007, 18:30
 *
 * To change this template, choose Tools | Template Manager
 * and open the template in the editor.
 */

package info.mikrotubula.managers;

import info.mikrotubula.db.Groups;
import info.mikrotubula.db.Rights;
import java.util.List;
import javax.ejb.Stateless;
import javax.persistence.EntityManager;
import javax.persistence.PersistenceContext;

/**
 *
 * @author Krystian
 */
@Stateless
public class RightsManagerBean implements info.mikrotubula.managers.RightsManagerLocal {
    
    @PersistenceContext(unitName = "persistence")
    protected EntityManager em;    
    
    /** Creates a new instance of RightsManagerBean */
    public RightsManagerBean() {
    }
    
    public List<Rights> getRightsList() {
        return (List<Rights>) em.createNamedQuery("Rights.findAll").getResultList();
    }
    
    public List<Groups> getGroupsList() {
        return (List<Groups>) em.createNamedQuery("Groups.findAll").getResultList();
    }
}
